package com.zj.controller;

import com.zj.domain.Myuser;
import com.zj.service.IuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("myuser")
public class UserController {
    @Autowired
    private IuserService service;

    @PostMapping("add")
    @ResponseBody
    public int addUser(@RequestBody Myuser myuser){
        return service.addUser(myuser);
    }

    @RequestMapping("get/{id}")
    @ResponseBody
    public Myuser getUser(@PathVariable("id") int userid){
        return service.selectUser(userid);
    }
}
